import 'package:flutter_module/login/userInfo.dart';


class WorkSpaceModel {
  
  String uuid;
  String name;
  int sort;
  String type;
  List<WorkSpaceDetailModel> menus;

  WorkSpaceModel();

  WorkSpaceModel.fromJson(Map<String, dynamic> json) {
    uuid = json['uuid'];
    name = json['name'];
    sort = json['sort'];
    type = json['type'];
    uuid = json['uuid'];

    List<WorkSpaceDetailModel> menus = [];
    for (var data in json['menus']) {
      WorkSpaceDetailModel detailModel = WorkSpaceDetailModel.fromJson(data);
      detailModel.status = EditStatus.normal;
      menus.add(detailModel);
    }
  this.menus = menus;

  }

}

enum EditStatus {
  normal,   /// 正常状态
  addition, /// 添加
  delete    /// 删除
}
class WorkSpaceDetailModel {

  String uuid;
  int createdTime;
  String creator;
  int modifiedTime;
  String modifier;
  String name;
  Map nameMap;
  String router;
  String iconKey;
  String iconUrl;
  String authorities;
  int sort;
  String groupId;
  bool isDefault;
  String modules;
  EditStatus status;

  WorkSpaceDetailModel();

  WorkSpaceDetailModel.fromJson(Map<String,dynamic> json){
    
    uuid = json['uuid'];
    creator = json['creator'];
    modifiedTime = json['modifiedTime'];
    modifier = json['modifier'];
    name = json['name'];
    nameMap = json['nameMap'];
    router = json['router'];
    iconKey = json['iconKey'];
    iconUrl = json['iconUrl'];
    sort = json['sort'];
    createdTime = json['createdTime'];
    groupId = json['groupId'];
    isDefault = json['isDefault'];
    modules = json['modules'];
    createdTime = json['createdTime'];
    authorities = json['authorities'];
  }

}